fn main() {
    //let width1 = 30;
    //let height1 = 50;
    //->
    //let rect1 = (30, 50);
    //->
    let rectangle = Rectangle {
        width: 30,
        height: 50,
    };

    println!("rectangle: {:?}", rectangle);
    println!("rectangle: {:#?}", rectangle);

    println!(
        "The area of the rectangle is {} square pixels.",
        //area(width1, height1)
        //->
        //area(rect1)
        //->
        area(&rectangle)
    );

    let scale = 2;
    let rectangle = Rectangle {
        width: dbg!(30 * scale),
        height: 50,
    };
    dbg!(&rectangle);
}

//fn area(width: u32, height: u32) -> u32 {
//    width * height
//}
//->
//fn area(dimensions: (u32, u32)) -> u32 {
//    dimensions.0 * dimensions.1
//}
//->
fn area(rectangle: &Rectangle) -> u32 {
    rectangle.height * rectangle.width
}

#[derive(Debug)]
struct Rectangle {
    width: u32,
    height: u32,
}
